package cn.gudian.cms.System

/**
 * Created by IntelliJ IDEA.
 * User: Administrator
 * Date: 2010-4-15
 * Time: 14:06:50
 * To change this template use File | Settings | File Templates.
 */
class Sys {
  private static Map map = null;

  public static String getValue(String varName) {

    if (map == null)
      saveMap();

    return map.get(varName).toString();

  }

  public static void saveMap() {
    map = new HashMap();
    def sysConfigInstance = SysConfig.list();
    sysConfigInstance.each {
      map.put(it.varName, it.varValue);
    }
  }
}
